import request from '@/utils/request'
import { getUsername } from '@/api/getUsername'

export function getApiConfig() {
  return request({
    url: '/conf/apiconfigs',
    method: 'get',
    params: {
      name: getUsername()
    }
  })
}

export function createApiConfig(data) {
  return request({
    url: '/conf/apiconfigs',
    method: 'post',
    data
  })
}

export function updateApiConfig(data) {
  return request({
    url: '/conf/apiconfigs',
    method: 'put',
    data
  })
}

export function deleteApiConfig(apiId) {
  return request({
    url: '/conf/apiconfigs',
    method: 'delete',
    params: { apiId: apiId }
  })
}
